package itheima;

    public class Phone {
        //私有成员变量;
        private String brand;
        private int price;
        private String color;
        public Phone() {
        }
        //有参构造
        public Phone(String brand, int price,String color) {
            this.brand = brand;
            this.price = price;
            this.color = color;
        }
        public String getBrand() {
            return brand;
        }
        public void setBrand(String brand) {
            this.brand = brand;
        }
        public int getPrice() {
            return price;
        }
        public void setPrice(int price) {
            this.price = price;
        }
        public String getColor() {
            return color;
        }
        public void setColor(String color) {
            this.color = color;
        }
        //手动封装
        public void show() {
            System.out.println("正在使用价格为"+ price + "元" + this.color + this.brand +"手机打电话");
            System.out.println("正在使用价格为"+ price + "元" + this.color + this.brand +"手机发短信");

        }
    }
    class TeacherTest {
        public static void main(String[] args) {
            Phone s1 = new Phone();
            s1.setBrand("小米");
            s1.setPrice(3998);
            s1.setColor("黑色");
            s1.show();
        }
    }